package br.com.single.modelo.estoque;

import br.com.single.modelo.financeiro.Cdfluxocaixa;
import br.com.single.publico.Cdfornec;
import br.com.single.publico.Cditemtabelageneri;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.dbre.RooDbManaged;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@Entity
@Table(schema = "estoque",name = "cdprodut")
@RooJavaBean
@RooToString
@RooJpaActiveRecord(versionField = "", table = "cdprodut", schema = "estoque")
@RooDbManaged(automaticallyDelete = true)
public class Cdprodut{

	
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "refereprodut", length = 10,columnDefinition="bpchar")
    private String refereprodut;

	
	@ManyToOne
	@JoinColumn(name = "fluxoentrad", referencedColumnName = "codigofluxo",columnDefinition="bpchar")
	private Cdfluxocaixa fluxoentrad;

	@ManyToOne
	@JoinColumn(name = "fluxosaida", referencedColumnName = "codigofluxo",columnDefinition="bpchar")
	private Cdfluxocaixa fluxosaida;

	@ManyToOne
	@JoinColumn(name = "marca", referencedColumnName = "codigofornec", nullable = false,columnDefinition="int4")
	private Cdfornec marca;

	@ManyToOne
	@JoinColumn(name = "ancorafornec", referencedColumnName = "codigofornec",columnDefinition="int4")
	private Cdfornec ancorafornec;

	@ManyToOne
	@JoinColumn(name = "ultimoforneccompra", referencedColumnName = "codigofornec",columnDefinition="int4")
	private Cdfornec ultimoforneccompra;

	@ManyToOne
	@JoinColumns({
			@JoinColumn(name = "tabeladc", referencedColumnName = "codigotabela",columnDefinition="bpchar"),
			@JoinColumn(name = "tabelacomiss", referencedColumnName = "elementabela",columnDefinition="bpchar") })
	private Cditemtabelageneri cditemtabelageneri;

	@ManyToOne
	@JoinColumns({
			@JoinColumn(name = "tabelast", referencedColumnName = "codigotabela", nullable = false,columnDefinition="bpchar"),
			@JoinColumn(name = "situactribut", referencedColumnName = "elementabela",columnDefinition="bpchar", nullable = false) })
	private Cditemtabelageneri cditemtabelageneri1;

	@ManyToOne
	@JoinColumns({
			@JoinColumn(name = "tabelatp", referencedColumnName = "codigotabela", nullable = false,columnDefinition="bpchar"),
			@JoinColumn(name = "tipoprodut", referencedColumnName = "elementabela", nullable = false,columnDefinition="bpchar") })
	private Cditemtabelageneri cditemtabelageneri2;

	@ManyToOne
	@JoinColumns({
			@JoinColumn(name = "tabelasg", referencedColumnName = "codigotabela", columnDefinition="bpchar",nullable = false),
			@JoinColumn(name = "subgrupo", referencedColumnName = "elementabela", nullable = false,columnDefinition="bpchar") })
	private Cditemtabelageneri cditemtabelageneri3;

	@ManyToOne
	@JoinColumns({
			@JoinColumn(name = "tabelagr", referencedColumnName = "codigotabela", nullable = false,columnDefinition="bpchar"),
			@JoinColumn(name = "grupo", referencedColumnName = "elementabela", nullable = false,columnDefinition="bpchar") })
	private Cditemtabelageneri cditemtabelageneri4;

	@ManyToOne
	@JoinColumns({
			@JoinColumn(name = "tabelaun", referencedColumnName = "codigotabela", nullable = false,columnDefinition="bpchar"),
			@JoinColumn(name = "unidadprodut", referencedColumnName = "elementabela", nullable = false,columnDefinition="bpchar") })
	private Cditemtabelageneri cditemtabelageneri5;

	@Column(name = "descriprodut", length = 60)
	@NotNull
	private String descriprodut;

	@Column(name = "referecomerc", length = 10,columnDefinition="bpchar")
	private String referecomerc;

	@Column(name = "codigobarra", length = 20,columnDefinition="bpchar")
	private String codigobarra;

	@Column(name = "descricomerc", length = 40,columnDefinition="bpchar")
	private String descricomerc;

	@Column(name = "fatorunidad")
	private Integer fatorunidad;

	@Column(name = "pesoliquid", precision = 17, scale = 17)
	private Double pesoliquid;

	@Column(name = "dimensromane")
	private Short dimensromane;

	@Column(name = "datacadast")
	@Temporal(TemporalType.DATE)
	@DateTimeFormat(style = "M-")
	private Date datacadast;

	@Column(name = "aliquoimpresfiscal", length = 2,columnDefinition="bpchar")
	private String aliquoimpresfiscal;

	@Column(name = "classifiscal", length = 10,columnDefinition="bpchar")
	private String classifiscal;

	@Column(name = "normasmercos", length = 10,columnDefinition="bpchar")
	private String normasmercos;

	@Column(name = "localfisica", length = 20,columnDefinition="bpchar")
	private String localfisica;

	@Column(name = "aplicabasica", length = 200)
	private String aplicabasica;

	@Column(name = "cancel")
	private Character cancel;

	@Column(name = "precoreposi", precision = 17, scale = 17)
	private Double precoreposi;

	@Column(name = "ultimoprecocompra", precision = 17, scale = 17)
	private Double ultimoprecocompra;

	@Column(name = "ultimadatacompra")
	@Temporal(TemporalType.DATE)
	@DateTimeFormat(style = "M-")
	private Date ultimadatacompra;

	@Column(name = "ancoravalor", precision = 17, scale = 17)
	private Double ancoravalor;

	@Column(name = "ancoradata")
	@Temporal(TemporalType.DATE)
	@DateTimeFormat(style = "M-")
	private Date ancoradata;

	@Column(name = "markuppadrao", precision = 17, scale = 17)
	private Double markuppadrao;

	@Column(name = "precovenda", precision = 17, scale = 17)
	private Double precovenda;

	@Column(name = "dataultimoajuste")
	@Temporal(TemporalType.DATE)
	@DateTimeFormat(style = "M-")
	private Date dataultimoajuste;

	@Column(name = "desconmaximo", precision = 17, scale = 17)
	private Double desconmaximo;

	public Cdfluxocaixa getFluxoentrad() {
		return fluxoentrad;
	}

	public void setFluxoentrad(Cdfluxocaixa fluxoentrad) {
		this.fluxoentrad = fluxoentrad;
	}

	public Cdfluxocaixa getFluxosaida() {
		return fluxosaida;
	}

	public void setFluxosaida(Cdfluxocaixa fluxosaida) {
		this.fluxosaida = fluxosaida;
	}

	public Cdfornec getMarca() {
		return marca;
	}

	public void setMarca(Cdfornec marca) {
		this.marca = marca;
	}

	public Cdfornec getAncorafornec() {
		return ancorafornec;
	}

	public void setAncorafornec(Cdfornec ancorafornec) {
		this.ancorafornec = ancorafornec;
	}

	public Cdfornec getUltimoforneccompra() {
		return ultimoforneccompra;
	}

	public void setUltimoforneccompra(Cdfornec ultimoforneccompra) {
		this.ultimoforneccompra = ultimoforneccompra;
	}

	public Cditemtabelageneri getCditemtabelageneri() {
		return cditemtabelageneri;
	}

	public void setCditemtabelageneri(Cditemtabelageneri cditemtabelageneri) {
		this.cditemtabelageneri = cditemtabelageneri;
	}

	public Cditemtabelageneri getCditemtabelageneri1() {
		return cditemtabelageneri1;
	}

	public void setCditemtabelageneri1(Cditemtabelageneri cditemtabelageneri1) {
		this.cditemtabelageneri1 = cditemtabelageneri1;
	}

	public Cditemtabelageneri getCditemtabelageneri2() {
		return cditemtabelageneri2;
	}

	public void setCditemtabelageneri2(Cditemtabelageneri cditemtabelageneri2) {
		this.cditemtabelageneri2 = cditemtabelageneri2;
	}

	public Cditemtabelageneri getCditemtabelageneri3() {
		return cditemtabelageneri3;
	}

	public void setCditemtabelageneri3(Cditemtabelageneri cditemtabelageneri3) {
		this.cditemtabelageneri3 = cditemtabelageneri3;
	}

	public Cditemtabelageneri getCditemtabelageneri4() {
		return cditemtabelageneri4;
	}

	public void setCditemtabelageneri4(Cditemtabelageneri cditemtabelageneri4) {
		this.cditemtabelageneri4 = cditemtabelageneri4;
	}

	public Cditemtabelageneri getCditemtabelageneri5() {
		return cditemtabelageneri5;
	}

	public void setCditemtabelageneri5(Cditemtabelageneri cditemtabelageneri5) {
		this.cditemtabelageneri5 = cditemtabelageneri5;
	}

	public String getDescriprodut() {
		return descriprodut;
	}

	public void setDescriprodut(String descriprodut) {
		this.descriprodut = descriprodut;
	}

	public String getReferecomerc() {
		return referecomerc;
	}

	public void setReferecomerc(String referecomerc) {
		this.referecomerc = referecomerc;
	}

	public String getCodigobarra() {
		return codigobarra;
	}

	public void setCodigobarra(String codigobarra) {
		this.codigobarra = codigobarra;
	}

	public String getDescricomerc() {
		return descricomerc;
	}

	public void setDescricomerc(String descricomerc) {
		this.descricomerc = descricomerc;
	}

	public Integer getFatorunidad() {
		return fatorunidad;
	}

	public void setFatorunidad(Integer fatorunidad) {
		this.fatorunidad = fatorunidad;
	}

	public Double getPesoliquid() {
		return pesoliquid;
	}

	public void setPesoliquid(Double pesoliquid) {
		this.pesoliquid = pesoliquid;
	}

	public Short getDimensromane() {
		return dimensromane;
	}

	public void setDimensromane(Short dimensromane) {
		this.dimensromane = dimensromane;
	}

	public Date getDatacadast() {
		return datacadast;
	}

	public void setDatacadast(Date datacadast) {
		this.datacadast = datacadast;
	}

	public String getAliquoimpresfiscal() {
		return aliquoimpresfiscal;
	}

	public void setAliquoimpresfiscal(String aliquoimpresfiscal) {
		this.aliquoimpresfiscal = aliquoimpresfiscal;
	}

	public String getClassifiscal() {
		return classifiscal;
	}

	public void setClassifiscal(String classifiscal) {
		this.classifiscal = classifiscal;
	}

	public String getNormasmercos() {
		return normasmercos;
	}

	public void setNormasmercos(String normasmercos) {
		this.normasmercos = normasmercos;
	}

	public String getLocalfisica() {
		return localfisica;
	}

	public void setLocalfisica(String localfisica) {
		this.localfisica = localfisica;
	}

	public String getAplicabasica() {
		return aplicabasica;
	}

	public void setAplicabasica(String aplicabasica) {
		this.aplicabasica = aplicabasica;
	}

	public Character getCancel() {
		return cancel;
	}

	public void setCancel(Character cancel) {
		this.cancel = cancel;
	}

	public Double getPrecoreposi() {
		return precoreposi;
	}

	public void setPrecoreposi(Double precoreposi) {
		this.precoreposi = precoreposi;
	}

	public Double getUltimoprecocompra() {
		return ultimoprecocompra;
	}

	public void setUltimoprecocompra(Double ultimoprecocompra) {
		this.ultimoprecocompra = ultimoprecocompra;
	}

	public Date getUltimadatacompra() {
		return ultimadatacompra;
	}

	public void setUltimadatacompra(Date ultimadatacompra) {
		this.ultimadatacompra = ultimadatacompra;
	}

	public Double getAncoravalor() {
		return ancoravalor;
	}

	public void setAncoravalor(Double ancoravalor) {
		this.ancoravalor = ancoravalor;
	}

	public Date getAncoradata() {
		return ancoradata;
	}

	public void setAncoradata(Date ancoradata) {
		this.ancoradata = ancoradata;
	}

	public Double getMarkuppadrao() {
		return markuppadrao;
	}

	public void setMarkuppadrao(Double markuppadrao) {
		this.markuppadrao = markuppadrao;
	}

	public Double getPrecovenda() {
		return precovenda;
	}

	public void setPrecovenda(Double precovenda) {
		this.precovenda = precovenda;
	}

	public Date getDataultimoajuste() {
		return dataultimoajuste;
	}

	public void setDataultimoajuste(Date dataultimoajuste) {
		this.dataultimoajuste = dataultimoajuste;
	}

	public Double getDesconmaximo() {
		return desconmaximo;
	}

	public void setDesconmaximo(Double desconmaximo) {
		this.desconmaximo = desconmaximo;
	}

	
}
